(deftemplate Pacient
	(multislot nume)
	(slot febra (allowed-values TRUE FALSE))
	(slot tuse)
    (slot stranut (allowed-values TRUE FALSE))
    (slot frisoane (allowed-values TRUE FALSE))
    (slot nasInfundat (allowed-values TRUE FALSE))
    (slot peteRosii (allowed-values TRUE FALSE))
    (slot apetitMancare (allowed-values TRUE FALSE))
    (slot cefalee (allowed-values TRUE FALSE))
    (slot respiratieUrata (allowed-values TRUE FALSE))
    (slot varsaturi (allowed-values TRUE FALSE))
    (slot balonare (allowed-values TRUE FALSE))
	(multislot dureri)
)
; ulcer
(assert (Pacient (nume Mihai Diana)
        		 (febra FALSE)
        		 (tuse nu)
        		 (stranut FALSE)
        		 (frisoane FALSE)
        		 (nasInfundat FALSE)
        		 (peteRosii FALSE)
        		 (apetitMancare FALSE)
        		 (cefalee FALSE)
        		 (respiratieUrata FALSE)
        		 (varsaturi TRUE)
        		 (balonare TRUE)
        		 (dureri in_zona_pieptului abdominale)
        ))

;raceala
(assert (Pacient (nume Cristescu Daniel)
        		 (febra TRUE)
        		 (tuse nu)
        		 (stranut TRUE)
        		 (frisoane FALSE)
        		 (nasInfundat TRUE)
        		 (peteRosii FALSE)
        		 (apetitMancare FALSE)
        		 (cefalee FALSE)
        		 (respiratieUrata FALSE)
        		 (varsaturi FALSE)
        		 (balonare FALSE)
        		 (dureri gat cap)
        ))

;gripa
(assert (Pacient (nume Moise Dorin)
        		 (febra TRUE)
        		 (tuse seaca)
        		 (stranut TRUE)
        		 (frisoane TRUE)
        		 (nasInfundat TRUE)
        		 (peteRosii FALSE)
        		 (apetitMancare FALSE)
        		 (cefalee FALSE)
        		 (respiratieUrata FALSE)
        		 (varsaturi FALSE)
        		 (balonare FALSE)
        		 (dureri cap musculare gat)
        ))
(defrule raceala
    (declare (salience -5))
    (Pacient (nume $? ?p ?n) (dureri gat cap) (febra ?x & TRUE) (stranut ?y & TRUE) (nasInfundat ?z & TRUE))
    =>
    (printout t "Persoana " ?p " " ?n " este diagnosticata cu raceala" crlf)
)
(defrule gripa
    (declare (salience 5))
    (Pacient (nume $? ?p ?n)(febra ?x & TRUE )(tuse seaca) (frisoane ?y & TRUE) (dureri cap musculare gat) (stranut ?z & TRUE) (nasInfundat ?t & TRUE))
	=> 
    (printout t "Persoana " ?p " " ?n " este diagnosticata cu gripa" crlf)  
)
(defrule varicela
    (declare (salience 15))
	(Pacient (nume $? ?p ?n) (febra ?x & TRUE) (apetitMancare ?y & TRUE) (dureri cap) (peteRosii ?z & TRUE))
    =>
    (printout t "Persoana " ?p " " ?n " este diagnosticata cu varicela" crlf)
)
(defrule sinuzita
    (declare (salience 25))
    (Pacient (nume $? ?p ?n) (febra ?x & TRUE) (dureri dentare) (respiratieUrata ?y & TRUE) (tuse abundenta) (cefalee ?z & TRUE))
    =>
    (printout t "Persoana " ?p " " ?n " este diagnosticata cu sinuzita" crlf)
)
(defrule ulcer
    (declare (salience 35))
    (Pacient (nume $? ?p ?n)(dureri in_zona_pieptului abdominale) (varsaturi ?x & TRUE) (balonare ?y & TRUE))
    =>
    (printout t "Persoana " ?p " " ?n " este diagnosticata cu ulcer" crlf)
)

(agenda)
(facts)
(run)

 